/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package com.stip.server.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author BlueBerry
 */
@Entity
@Table(name = "user_act")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "UserAct.findAll", query = "SELECT u FROM UserAct u"),
    @NamedQuery(name = "UserAct.findById", query = "SELECT u FROM UserAct u WHERE u.id = :id"),
    @NamedQuery(name = "UserAct.findByStatues", query = "SELECT u FROM UserAct u WHERE u.statues = :statues")})
public class UserAct implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Column(name = "statues")
    private Integer statues;
    @JoinColumn(name = "user_id", referencedColumnName = "uid")
    @ManyToOne
    private UsersMain userId;
    @JoinColumn(name = "act_id", referencedColumnName = "id")
    @ManyToOne
    private Activeties actId;

    public UserAct() {
    }

    public UserAct(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getStatues() {
        return statues;
    }

    public void setStatues(Integer statues) {
        this.statues = statues;
    }

    public UsersMain getUserId() {
        return userId;
    }

    public void setUserId(UsersMain userId) {
        this.userId = userId;
    }

    public Activeties getActId() {
        return actId;
    }

    public void setActId(Activeties actId) {
        this.actId = actId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserAct)) {
            return false;
        }
        UserAct other = (UserAct) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.stip.server.entities.UserAct[ id=" + id + " ]";
    }
    
}
